﻿@model Tuple<IEnumerable<HCM_maps_website.Models.ServiceModel>,IEnumerable<HCM_maps_website.Models.PlaceModels>>
    @if (Model == null || (Model.Item1==null && Model.Item2==null) 
        || (Model.Item1 == null && Model.Item2.Count() == 0) || (Model.Item2 == null && Model.Item1.Count() == 0)
        || (Model.Item1.Count() ==0 && Model.Item2.Count()==0))
    {
        <li id="notfound">Không tìm thấy kết quả</li>
    }else
    {
        if (Model.Item1 != null)
        {
            foreach (HCM_maps_website.Models.ServiceModel service in Model.Item1)
            {
            <li>
                <h5>@service.FullName</h5>
                <a class="address">@service.Address</a>
                <span class="function" datalat="@service.Coordinate.Longitude" datalong="@service.Coordinate.Latitude">
                    <a href="javascript:void(0)" class="viewmap">Xem</a>
                    <a href="javascript:void(0)" class="setstartpoint">Điểm đi</a>
                    <a href="javascript:void(0)" class="setendpoint">Điểm đến</a>
                    <a href="javascript:void(0)" class="findplacearound">Xung quanh</a>
                    @if(Session["Account"]!=null){
                        <a href="javascript:void(0)" class="saveplace" id="@service.ID">Lưu</a>
                    }
                </span>
            </li>
            }
        }
        if (Model.Item2 != null)
        {
            foreach (HCM_maps_website.Models.PlaceModels place in Model.Item2)
            {
            <li>
                <h5>@place.Name</h5>
                <a class="address">@place.HomeNumber @place.Area</a>
                <span class="function" datalat="@place.Coordinate.Longitude" datalong="@place.Coordinate.Latitude">
                    <a href="javascript:void(0)" class="viewmap">Xem</a>
                    <a href="javascript:void(0)" class="setstartpoint">Điểm đi</a>
                    <a href="javascript:void(0)" class="setendpoint">Điểm đến</a>
                    <a href="javascript:void(0)" class="findplacearound">Xung quanh</a>
                    @if(Session["Account"]!=null){
                        <a href="javascript:void(0)" class="saveplace" id="@place.ID">Lưu</a>
                    }
                </span>
            </li>
            }
        }
    }